﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using HeyoUi.Util;

namespace Heyo.Launcher.Util
{
    internal class OptifineInstaller
    {
        public static bool InstallWithForge(string fullPath,string target)
        {
            string modDirectory = GameLocator.GetModDirectory(target);
            if (!Directory.Exists(modDirectory))
                Directory.CreateDirectory(modDirectory);

            if (!File.Exists(fullPath))
                return false;

            File.Copy(fullPath, Path.Combine(modDirectory, Path.GetFileName(fullPath) ?? throw new InvalidOperationException()), true);

            return true;
        }
    }
}
